package pattern6.resume;

/**
 * 通过实现Cloneable接口来实现克隆
 */
public class Resume implements Cloneable {

    private String name;
    private String company;

    public Resume(String name){
        this.name=name;
    }

    public void setCompany(String company){
        this.company=company;
    }

    public void displayCompany(){
        System.out.println(company);
    }
    @Override
    protected Object clone() {
        Object clone = null;
        try {
            clone = super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return clone;
    }
}
